package chp03.homework;

import java.util.Scanner;

public class Home5 {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入是否是会员:是(y)/否(其他字符)");
        String answer = input.next();
        System.out.println("请输入购物金额:");
        double money = input.nextDouble();

        //折扣
        double discount = 1;
        if (answer.equals("y")) {
            System.out.println("是会员");
            if (money >= 200) {
                discount = 0.75;
            } else if (money >= 100) {
                discount = 0.8;
            }
        } else {
            System.out.println("普通顾客");
            if (money >= 100) {
                discount = 0.9;
            }
        }
        money = money * discount;
        System.out.println("实际支付:" + money);
    }
}
